Repository navigation
ref(nav3): [Part 6] Share bounded argument conversion - #6702
0xadam-brown wants to merge 2 commits into
Conversation
PR risk: mediumFor commit Main concerns: data sent to Sentry, dependencies customers inherit, reach. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d03d53a. Configure here.
| val isKeyTaken = key != null && (containers.last() as? Map<*, *>)?.containsKey(key) == true | ||
| if (isKeyTaken && !key.isSubstitute()) { | ||
| throw DropArguments(ArgumentDropReason.DUPLICATE_KEY, DropArguments.DUPLICATE_KEY_WARNING) | ||
| } |
There was a problem hiding this comment.
Duplicate keys spend shared value budget
Low Severity
visitValue calls spendValue before the duplicate-key check, so a rejected duplicate still consumes one slot of the shared update budget. DUPLICATE_KEY is not supposed to exhaust that budget, but if the overflowing entry was already at the last remaining slot, the next older entry then fails with MAX_COUNT and older entries lose their arguments.
Reviewed by Cursor Bugbot for commit d03d53a. Configure here.


PR Stack (Nav3 Serial Name Mappers)
📜 Description
PR introduces the
ArgumentSource<>ArgumentSinkpair that lets us support differentiated processing on the source side (the host app's logic vs built-in mapper logic) but uniform processing on the sink side (argument pruning, protecting against constraint violation, and argument tree materialization). Absent that pair, we'd have to duplicate the latter for our built-in mappers, causing them to processing the argument tree twice.💡 Motivation and Context
With Nav3, host apps manage their own nav back stack, which they implement as a list of arbitrarily typed entries. In order to be displayed in Sentry, each of those entries has to be mapped to a Sentry name (e.g., ProductDetailScreen) and zero or more arguments (e.g., productId). There are two ways for host apps to provide us with those mappings:
BackStackEntryMapper; orBackStackEntryMapper.SerialNameorBackStackEntryMapper.SerialNameAndProperties).As mentioned above, the new
ArgumentSourceandArgumentSinktypes let custom and built-in mappers apply different processing procedures, while sending the outputs of both through the shared sink pipeline. (Later PRs will take advantage of the source's ability to apply different processing policies).Here are the moving parts:
addresses: JAVA-787 (link)
💚 How did you test it?
Nav3 release build and all 561 unit tests passed. Repository-wide
make format api, Spotless checks, ABI validation, and Detekt passed.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue with PR 7: Add the SerialName mapper.
#skip-changelog